package com.example.dubbo.service.storage.impl.demo;

import com.example.dubbo.aip.demo.StorageTblService;
import com.example.dubbo.aip.vo.demo.StorageTbl;
import com.example.dubbo.service.storage.mapper.demo.StorageTblMapper;
import org.apache.dubbo.config.annotation.Service;

import javax.annotation.Resource;

/**
 * 商品库存ServiceImpl
 * ClassName:StorageTbl
 * Description: 用于Seata 分布式事务测试
 */
@Service(version = "1.0.0",timeout = 30000)
public class StorageTblServiceImpl implements StorageTblService {
    @Resource
    private StorageTblMapper storageTblMapper;

    @Override
    public void subtractStorage() {
        StorageTbl entity =new StorageTbl();
        entity.setId(1);
        entity.setCommodityCode("2001");
        entity.setCount(999);
        storageTblMapper.updateByPrimaryKey(entity);
    }
}